#include "ThreadPool.hpp"
#include "Task.hpp"
#include <sys/types.h>
#include <unistd.h>
#include <memory>
#include<ctime>

int main()
{
    //lg.Eable(classfile);
    srand((uint16_t)time(nullptr) ^ getpid());
    
    //std::unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    ThreadPool<Task>::Getinstance()->Start();
   
    
    while(true)
    {
        int x=rand()%10;
        usleep(123);
        int y=rand()%10;
        char op=opers[rand()%opers.size()];
        Task t(x,y,op);
        //std::cout<<t.PrintTask()<<std::endl;
        ThreadPool<Task>::Getinstance()->Push(t);
    
        sleep(1);
        
    }
    ThreadPool<Task>::Getinstance()->Wait();
    return 0;
}